home *** CD-ROM | disk | FTP | other *** search
/ MacAddict 104 / MacAddict_104_2005-04.iso / Software / Internet & Communication / WordPress 1.2.2 freeware.dmg / wordpress / wp-admin / options-reading.php < prev    next >
Encoding:
PHP Script  |  2004-10-06  |  3.9 KB  |  103 lines

  1. <?php
  2. require_once('../wp-includes/wp-l10n.php');
  3.  
  4. $title = 'Reading Options';
  5. $parent_file = 'options-general.php';
  6.  
  7. function add_magic_quotes($array) {
  8.     foreach ($array as $k => $v) {
  9.         if (is_array($v)) {
  10.             $array[$k] = add_magic_quotes($v);
  11.         } else {
  12.             $array[$k] = addslashes($v);
  13.         }
  14.     }
  15.     return $array;
  16. }
  17.  
  18. if (!get_magic_quotes_gpc()) {
  19.     $_GET    = add_magic_quotes($_GET);
  20.     $_POST   = add_magic_quotes($_POST);
  21.     $_COOKIE = add_magic_quotes($_COOKIE);
  22. }
  23.  
  24. $wpvarstoreset = array('action','standalone', 'option_group_id');
  25. for ($i=0; $i<count($wpvarstoreset); $i += 1) {
  26.     $wpvar = $wpvarstoreset[$i];
  27.     if (!isset($$wpvar)) {
  28.         if (empty($_POST["$wpvar"])) {
  29.             if (empty($_GET["$wpvar"])) {
  30.                 $$wpvar = '';
  31.             } else {
  32.                 $$wpvar = $_GET["$wpvar"];
  33.             }
  34.         } else {
  35.             $$wpvar = $_POST["$wpvar"];
  36.         }
  37.     }
  38. }
  39.  
  40. $standalone = 0;
  41. include_once('admin-header.php');
  42. include('options-head.php');
  43. ?>
  44.  
  45. <div class="wrap"> 
  46.     <h2><?php _e('Reading Options') ?></h2> 
  47.     <form name="form1" method="post" action="options.php"> 
  48.         <input type="hidden" name="action" value="update" /> 
  49.         <input type="hidden" name="page_options" value="'posts_per_page','what_to_show','posts_per_rss','rss_use_excerpt','blog_charset','gzipcompression' " /> 
  50.         <fieldset class="options"> 
  51.         <legend><?php _e('Front Page') ?></legend> 
  52.         <table width="100%" cellspacing="2" cellpadding="5" class="editform"> 
  53.             <tr valign="top"> 
  54.                 <th width="33%" scope="row"><?php _e('Show the most recent:') ?></th> 
  55.                 <td><input name="posts_per_page" type="text" id="posts_per_page" value="<?php echo get_settings('posts_per_page'); ?>" size="3" /> 
  56.                     <select name="what_to_show" id="what_to_show" > 
  57.                         <option value="days" <?php selected('days', get_settings('what_to_show')); ?>>days</option> 
  58.                         <option value="posts" <?php selected('posts', get_settings('what_to_show')); ?>>posts</option> 
  59.                         <option value="paged" <?php selected('paged', get_settings('what_to_show')); ?>>posts paged</option> 
  60.                     </select> </td> 
  61.             </tr> 
  62.         </table> 
  63.         </fieldset> 
  64.  
  65.         <fieldset class="options"> 
  66.         <legend><?php _e('Syndication Feeds') ?></legend> 
  67.         <table width="100%" cellspacing="2" cellpadding="5" class="editform"> 
  68.             <tr valign="top"> 
  69.                 <th width="33%" scope="row"><?php _e('Show the most recent:') ?></th> 
  70.                 <td><input name="posts_per_rss" type="text" id="posts_per_rss" value="<?php echo get_settings('posts_per_rss'); ?>" size="3" /> 
  71.                     posts </td> 
  72.             </tr>
  73.             <tr valign="top">
  74.                 <th scope="row"><?php _e('For each article, show:') ?> </th>
  75.                 <td><label>
  76.                     <input name="rss_use_excerpt"  type="radio" value="0" <?php checked(0, get_settings('rss_use_excerpt')); ?>  />
  77.                     full text</label>                    <br>
  78.                     <label>
  79.                     <input name="rss_use_excerpt" type="radio" value="1" <?php checked(1, get_settings('rss_use_excerpt')); ?> />
  80.                     summary</label> </td>
  81.             </tr> 
  82.         </table> 
  83.         </fieldset> 
  84.                 <table width="100%" cellspacing="2" cellpadding="5" class="editform"> 
  85.             <tr valign="top"> 
  86.                 <th width="33%" scope="row"><?php _e('Encoding for pages and feeds:') ?></th> 
  87.                 <td><input name="blog_charset" type="text" id="blog_charset" value="<?php echo get_settings('blog_charset'); ?>" size="20" class="code" />
  88.                     <br />
  89.                  <?php _e('The character encoding you write your blog in (UTF-8 <a href="http://developer.apple.com/documentation/macos8/TextIntlSvcs/TextEncodingConversionManager/TEC1.5/TEC.b0.html">recommended</a>)') ?></td> 
  90.             </tr>
  91.         </table> 
  92.         <p>
  93.             <label>
  94.             <input type="checkbox" name="gzipcompression" value="1" <?php checked('1', get_settings('gzipcompression')); ?> /> 
  95.              <?php _e('WordPress should compress articles (gzip) if browsers ask for them') ?></label>
  96.         </p>
  97.         <p class="submit"> 
  98.             <input type="submit" name="Submit" value="<?php _e('Update Options') ?> »" /> 
  99.         </p> 
  100.     </form> 
  101. </div> 
  102. <?php include("admin-footer.php") ?>
  103.